You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
먼저 여러 문제에 대한 깔끔한 해결책을 제출해주셔서 감사합니다! 전체적으로 가독성이 좋고, 알고리즘도 적합한 접근법을 사용하고 계십니다. 몇 가지 개선점을 제안드리자면:
시간/공간 복잡도 명시 요청: 각 솔루션에 TC와 SC를 명확히 표기하는 것이 좋습니다. 예를 들어, invertTree는 TC: O(n), SC: O(h) (최악의 경우 트리 높이)로, jumpGame은 캐시 활용 시 TC: O(n), SC: O(n) 등으로 작성하면 리뷰어가 이해하기 쉽습니다.
invertTree: 재귀 DFS 방식은 효율적이며, 가독성도 좋습니다. 다만, Optional[TreeNode] 타입 힌트가 누락되어 있는데, 이를 추가하면 더욱 명확해집니다.
jumpGame: 캐시를 활용한 재귀는 좋은 선택입니다. 다만, @cache 데코레이터를 사용하려면 from functools import cache를 임포트하는 부분이 필요합니다. 또한, 시간복잡도 분석에 대한 명확한 표기와, 최적화를 위해 lru_cache를 사용할 수도 있습니다.
search in rotated sorted array: 이진 탐색의 구현이 깔끔하며, 시간복잡도도 정확히 표기되어 있습니다. 다만, List 타입 힌트가 누락돼 있으니 from typing import List도 추가하는 게 좋습니다.
전반적으로 코드 가독성과 알고리즘이 적합합니다. 조금만 타입 힌트와 임포트 명시를 추가하면 더 완성도 높은 PR이 될 것 같습니다. 수고하셨고, 앞으로도 좋은 풀이 기대할게요!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
답안 제출 문제
작성자 체크 리스트
In Review로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!